package com.epfresh.supplier.entity;

public class HomePart implements Comparable<HomePart> {
    private String name;
    private int sort;

    public HomePart(String name, int sort) {
        this.name = name;
        this.sort = sort;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    @Override
    public int compareTo(HomePart homePart) {           //重写Comparable接口的compareTo方法，
        return this.sort - homePart.getSort();// 降序修改相减顺序即可
    }
}
